<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="__ROOT__/layui/lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="__ROOT__/layui/lib/jq-module/zyupload/zyupload-1.0.0.min.css" media="all">
    <link rel="stylesheet" href="__ROOT__/layui/css/public.css" media="all">
    <style>
        body {
            background-color: #ffffff;
        }
    </style>
</head>
<body>
<form class="layui-form column-content-detail" method="post" action="{:url('order/add_up_file')}" enctype="multipart/form-data">
    <blockquote class="layui-elem-quote">
        上传说明：每次上传一个文档，可以上传多次，上传之后，可以点击项目初审，查看上传文件<br>
    </blockquote>
    <div class="layui-tab">
        <div class="layui-tab-content">
            <input name="order_id" value="{$id}" style="display: none">
            <div class="layui-tab-item layui-show">

                <div class="layui-form-item">
                    <label class="layui-form-label">选择文件:</label>
                    <div class="layui-input-block">
                        <input name="myFile" type="file" required class="layui-input">
                    </div>
                </div>



            </div>
        </div>
    </div>
    </div>
    <div class="layui-form-item" style="padding-left: 10px;">
        <div class="layui-input-block">
            <button class="layui-btn layui-btn-normal">立即提交</button>
        </div>
    </div>
</form>
<script src="__ROOT__/layui/lib/jquery-3.4.1/jquery-3.4.1.min.js" charset="utf-8"></script>
<script src="__ROOT__/layui/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script src="__ROOT__/layui/lib/jq-module/zyupload/zyupload-1.0.0.min.js" charset="utf-8"></script>
<script>
    layui.use(['upload','form'], function () {
        var form = layui.form,
            layer = layui.layer,
            upload = layui.upload,
            $ = layui.$;

        //监听提交
        form.on('submit(saveBtn)', function (data) {
            var url = "{:url('order/up_add')}";
            var data=(data.field);
            var success = "{:url('order/check')}";
            //    执行异步请求 ，$.post
            $.post(url,data,function(result){
                if(result.status ==0){
                    layer.open({
                        content:result.message,
                        icon:2,
                        title : '错误提示'
                    });

                }
                if(result.status ==1){
                    layer.open({
                        content : result.message,
                        icon : 1,
                        yes : function(){
                            // location.href=success;
                            setTimeout(function () {
                                window.parent.location.reload(); //刷新父页面
                                var index = parent.layer.getFrameIndex(window.name)
                                parent.layer.close(index);
                            }, 500);
                        }
                    });

                }

            },'JSON');
            return false;

        });



    });
</script>
<script type="text/javascript">
    layui.use(['form', 'jquery', 'layer', 'dialog'], function() {
    })
    editor.sync();
</script>
</body>
</html>